//
//  FSTitleBtn.m
//  fanshu
//
//  Created by 许海峰 on 16/3/27.
//  Copyright © 2016年 FS. All rights reserved.
//

#import "FSTitleBtn.h"

@implementation FSTitleBtn

- (void)layoutSubviews {
    [super layoutSubviews];
    
    if (self.titleLabel.x > self.imageView.x) {
        self.titleLabel.x = self.imageView.x;
        self.imageView.x = CGRectGetMaxX(self.titleLabel.frame);
    }
}

- (void)setTitle:(NSString *)title forState:(UIControlState)state {
    
    
    [super setTitle:title forState:state];
    //自适应按钮大小
    [self sizeToFit];
    
}

@end
